#!/bin/bash

usage()
{
    echo "clean-cloud.sh <vmname>"
    exit 1
}

VM_NAME=$1
if [ -z "${VM_NAME}" ]; then
    usage
fi

virt-customize -a /var/lib/libvirt/images/${VM_NAME}.qcow2 \
    --run-command 'cloud-init clean' 
    